package com.xj0927.springcloud.entities;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: xj0927
 * @Description: 返回给前端的结果信息
 * @Date Created in 2020-10-22 16:10
 * @Modified By:
 */
@Data
@AllArgsConstructor //全参构造器
@NoArgsConstructor  //空参构造器
public class CommonResult<T>{ //使用泛型：方便传回数据

    private Integer code;
    private String message;
    private T  data;

    //为了方便以后使用：再来个不带数据的构造器
    public CommonResult(Integer code,String message){
        this.code = code;
        this.message = message;
    }
}
